
from PyQt5.QtGui import QColor
from pyqtgraph import mkPen, mkBrush, examples

import bitMap
import pyqtgraph as pg
import numpy as np


class drawMapGraph(object):
    def __init__(self):
        pass

    def __del__(self):
        pass

    @classmethod
    def line_plot(cls, view):
        plt = pg.PlotWidget(view)
        plt.resize(900, 300)
        plt.plot([i for i in range(10)], [i * i for i in range(10)])
        plt.show()

    @classmethod
    def scatter_plot(cls, view):
        plt2 = pg.PlotWidget(view)
        # x = np.random.normal(size=1000)
        # y = np.random.normal(size=1000)
        x = [0, 1, 2, 3, 4, 5]
        y = [1, 2, 3, 4, 4, 5]
        plt2.resize(900, 300)
        # name_list = ['o', 's', 't', 't1', 't2', 't3', 'd', '+', 'x', 'p', 'h', 'star',
        #              'arrow_up', 'arrow_right', 'arrow_down', 'arrow_left', 'crosshair']
        brush = mkBrush(QColor('#FFE6D9'))
        plt2.plot(x, y, pen=None, symbol="s", symbolPen=None, symbolBrush=brush)
        plt2.show()

    @classmethod
    def draw_map(cls, map_dict: dict):
        pass

    @classmethod
    def three_curves(cls, view):
        plt3 = pg.PlotWidget(view, title="Three plot curves")
        x = np.arange(1000)
        y = np.random.normal(size=(3, 1000))
        plt3.resize(900, 300)
        for i in range(3):
            plt3.plot(x, y[i], pen=(i, 3))  # setting pen=(i,3) 自动创建3个不同颜色的笔
        plt3.show()

    @classmethod
    def show_example(cls):
        pg.examples.run()
